package com.sl.happying.reading.dao;

import com.sl.happying.reading.bean.Chapter;
import com.sl.happying.reading.bean.Novel;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface ChapterDao extends JpaRepository<Chapter, Integer> {

    @Query("from Chapter where novel.novelName=?1 and chapterName=?2")
    Chapter findByChapterName(String novelName, String chapterName);
}
